package com.yunhe.history.constant;

/**
 * Tsdb常量类
 *
 * @author liuronglei
 */
public class TsdbConsts {

    public enum MEAS_COLUMN {
        FLAG("flag", "标记位");
        private String value;
        private String title;

        MEAS_COLUMN(String value, String title) {
            this.value = value;
            this.title = title;
        }

        public String value() {
            return value;
        }

        public String title() {
            return title;
        }
    }

    public enum AGGREGATOR {
        AVG("avg", "平均值_线性插值（斜率拟合）"),
        COUNT("count", "数据点数_插0"),
        MIMMIN("mimmin", "最小值_插最大值"),
        MIMMAX("mimmax", "最大值_插最小值"),
        MIN("min", "最小值_线性插值"),
        MAX("max", "最大值_线性插值"),
        NONE("none", "不做计算_插0"),
        SUM("sum", "求和_线性插值"),
        ZIMSUM("zimsum", "求和_插0");
        private String value;
        private String title;

        AGGREGATOR(String value, String title) {
            this.value = value;
            this.title = title;
        }

        public String value() {
            return value;
        }

        public String title() {
            return title;
        }
    }

    public enum DOWNSAMPLE_AGGREGATOR {
        AVG("avg", "平均值"),
        COUNT("count", "数据点数"),
        FIRST("first", "取第一个值"),
        LAST("last", "取最后一个值"),
        MIN("min", "最小值"),
        MAX("max", "最大值"),
        SUM("sum", "求和"),
        ZIMSUM("zimsum", "求和");
        private String value;
        private String title;

        DOWNSAMPLE_AGGREGATOR(String value, String title) {
            this.value = value;
            this.title = title;
        }

        public String value() {
            return value;
        }

        public String title() {
            return title;
        }
    }

    public enum DOWNSAMPLE_FILL_POLICY {
        NONE("none", "默认行为，不填值"),
        NAN("nan", "NaN"),
        NULL("null", "null"),
        ZERO("zero", "0"),
        LINEAR("linear", "线性填充值"),
        PREVIOUS("previous", "之前的一个值"),
        NEAR("near", "邻近的一个值"),
        AFTER("after", "之后的一个值"),
        FIXED("fixed", "用指定的一个固定填充值");
        private String value;
        private String title;

        DOWNSAMPLE_FILL_POLICY(String value, String title) {
            this.value = value;
            this.title = title;
        }

        public String value() {
            return value;
        }

        public String title() {
            return title;
        }
    }

    public enum MEAS_FLAG {
        TRUE(1, "真"),
        FALSE(0, "假");
        private Integer value;
        private String title;

        MEAS_FLAG(Integer value, String title) {
            this.value = value;
            this.title = title;
        }

        public Integer value() {
            return value;
        }

        public String title() {
            return title;
        }
    }
}
